const Mock = require("mockjs");
const Random = Mock.Random;

function getQuestionList({ len = 10, isStar, isDeleted }) {
  const list = [];
  for (let i = 0; i < len; i++) {
    list.push({
      id: Random.id(),
      title: Random.ctitle(),
      isPublished: Random.boolean(),
      isStar: isStar ? isStar : Random.boolean(),
      answerCount: Random.natural(0, 100),
      createdAt: Random.datetime(),
      isDeleted,
    });
  }
  return list;
}

module.exports = getQuestionList;
